<script src="__PUBLIC__/layuiadmin/layui/layui.js"></script>

<script>
    layui.config({
        base: '/Public/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');

    //JavaScript代码区域
    layui.use(['element','layer','jquery'], function(){
        var element = layui.element;
        var layer = layui.layer,
         $ = layui.jquery;

        $("#Eliminate").on("click",function(){
            $.ajax({
                type:'get',
                dataType:"json",
                url:'/Index/Eliminate',
                success:function (data) {
                   layer.msg('正在清除缓存中，请等待',{icon: 16,time:3000,shade:0.8,offset: 'auto',
                        end:function () {
                            if(data['code'] == 1){
                                layer.msg(data['msg'], {icon: 1,time:1000,offset: 'auto',end:function () {
                                        window.location.reload();
                                 }});
                            }else{
                                layer.msg(data['msg'], {icon: 2,time:1000,offset: 'auto',end:function () {
                                        window.location.reload();
                                }});
                         }
                   }});
                },
                error:function () {
                    layer.msg('发生错误', {icon: 2});
                },
            });
        });
    });
</script>



